﻿//
// Created by francklinson on 2021/3/21.
//

#ifndef CPPPRIMERPLUSREADINGCODES_STACK_H
#define CPPPRIMERPLUSREADINGCODES_STACK_H
#include <iostream>

typedef unsigned long Item;

class Stack
{
private:
    enum
    {
        MAX = 10
    }; // constant specific to class
    Item items[MAX]; // holds stack items
    int top; // index for top stack item
public:
    Stack();

    bool isEmpty() const;

    bool isFull() const;

    // push() returns false if stack already is full, true otherwise
    bool push(const Item &item); // add item to stack
    // pop() returns false if stack already is empty, true otherwise
    bool pop(Item &item); // pop top into item
    void show(); // show the stack contents
};

#endif //CPPPRIMERPLUSREADINGCODES_STACK_H
